//
//  JSMStrategyInfoTableViewCell.m
//  TakeYouTourTogether
//
//  Created by king on 15/12/7.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMStrategyInfoTableViewCell.h"

@implementation JSMStrategyInfoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatStrategyInfoTableViewCell];
    }
    return self;
}

- (void)creatStrategyInfoTableViewCell {
    self.titellabel = [[UILabel alloc] initWithFrame:CGRectZero];
    //self.titellabel.backgroundColor = [UIColor brownColor];
    self.titellabel.font = [UIFont systemFontOfSize:23];
    [self.contentView addSubview:self.titellabel];
    
    self.contentLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    //self.contentLabel.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.contentLabel];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:17], NSFontAttributeName, nil];
    CGRect rect = [self.contentLabel.text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 40, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    self.titellabel.frame = CGRectMake(20, 20, SCREEN_WIDTH, 30);
    self.contentLabel.frame = CGRectMake(20 , 50, SCREEN_WIDTH-40, rect.size.height);
    
    self.contentLabel.numberOfLines = 0;
    [self.contentLabel sizeToFit];
    
    
}

@end
